<input type="hidden" value="123" class="lng"/>
<script src="http://maps.google.cn/maps/api/js?sensor=false"></script>

<script>
    var addr = $('input:text[name="address"]');
    addr.blur(function(){
        var lng = null;
        var lat = null;
        var address = addr.val();
        if(address != ""){
            var geocoder = new google.maps.Geocoder();
            geocoder.geocode( {
                'address' : addr.address
            }, function(results, status) {
                if (status == google.maps.GeocoderStatus.OK) {

                    //results数组里有很多有用的信息，包括坐标和返回的标准位置信息
                    lng = results[0].geometry.viewport.N.j;
                    lat = results[0].geometry.viewport.j.j;
                    console.log(results);

                }else{
                    alert(address);
                }
            });
        }

        setTimeout(function(){
//            $('.lng').val("123");
            console.log(lng);
            console.log(lat);
            $("#lat").attr("value","123");
        },3000)

    });


    console.log($('.lng').val(1234));
    console.log($('.lng').val());
</script>